import {createUploadService} from "plain-design";
import {http} from "./http";
import {pathJoin} from "@peryl/utils/pathJoin";
import {env} from "../../env";

export const upload = createUploadService({
  action: pathJoin(env.baseURL, 'saveFile'),
  filename: 'file',
  http,
  prefix: env.assetsPrefix,
  getFilePathFromResponse: resp => resp.result.path,
});
